Skip to content

fix: ignore create and update outputs for Rule - #63

Open
michaelhtm wants to merge 1 commit into
aws-controllers-k8s:mainfrom
michaelhtm:fix/dontremoveref
Open

michaelhtm wants to merge 1 commit into
aws-controllers-k8s:mainfrom
michaelhtm:fix/dontremoveref

Conversation

@michaelhtm

@michaelhtm michaelhtm commented Oct 16, 2025

Copy link
Copy Markdown
Member

Issue #2652

Description of changes:

Currently, when AWS returns the output of CreateRule or UpdateRule,
it returns a list of Actions, which hold TargetGroupArns.
TargetGroups can also be referenced from a k8s TargetGroup object.
When AWS returns the list of Actions, the generated code creates a new
Action struct and populates it with the values from the sdk output
(which do not include the references).
If the user sets a targetGroupRef, we do not have a way to figure out
the correct Action to assign the returned targetGroupRef.

This change ignores setting Actions returned by CreateRule and
UpdateRule so references are preserved on the write path. The ReadOne
path still reads Actions back for drift detection, so Actions is now
compared with a custom comparator (compare.is_ignored) that strips the
k8s-only targetGroupRef and normalizes the server-assigned Order while
still comparing the resolved targetGroupARN. This avoids a redundant
ModifyRule on every reconcile that would otherwise be triggered by the
ref being absent from the observed state.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow
ack-prow Bot requested review from knottnt and rushmash91 October 16, 2025 20:37
@ack-prow ack-prow Bot added the approved label Oct 16, 2025
@michaelhtm

Copy link
Copy Markdown
Member Author

/hold

@ack-prow ack-prow Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 16, 2025

@a-hilaly a-hilaly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@ack-prow ack-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2025
@ack-prow

ack-prow Bot commented Feb 20, 2026

Copy link
Copy Markdown

@michaelhtm: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
elbv2-crd-compat-check 38f601e link true /test elbv2-crd-compat-check

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ack-prow ack-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
@michaelhtm

Copy link
Copy Markdown
Member Author

/label release/patch

@ack-prow ack-prow Bot added the release/patch Indicates this PR should trigger a patch version release on merge. label Jun 26, 2026

@sapphirew sapphirew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@ack-prow ack-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
@ack-prow

ack-prow Bot commented Jun 26, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, michaelhtm, sapphirew

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [a-hilaly,michaelhtm,sapphirew]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Currently, when AWS returns the output of CreateRule or UpdateRule,
it returns a list of Actions, which hold TargetGroupArns.
TargetGroups can also be referenced from a k8s TargetGroup object.
When AWS returns the list of Actions, the generated code creates a new
Action struct and populates it with the values from the sdk output
(which do not include the references).
If the user sets a targetGroupRef, we do not have a way to figure out
the correct Action to assign the returned targetGroupRef.

This change ignores setting Actions returned by CreateRule and
UpdateRule so references are preserved on the write path. The ReadOne
path still reads Actions back for drift detection, so Actions is now
compared with a custom comparator (compare.is_ignored) that strips the
k8s-only targetGroupRef and normalizes the server-assigned Order while
still comparing the resolved targetGroupARN. This avoids a redundant
ModifyRule on every reconcile that would otherwise be triggered by the
ref being absent from the observed state.
@ack-prow ack-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
@ack-prow

ack-prow Bot commented Jun 26, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@michaelhtm

Copy link
Copy Markdown
Member Author

/unhold

@ack-prow ack-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved release/patch Indicates this PR should trigger a patch version release on merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants